<template>
  <div>
    <ul>
      <li @click="search(4)">
        <span class="iconfont icon-shangxiajiantou"></span>
        <p ref="li4">智能排序</p>
      </li>
      <li @click="search(5) ">
        <span class="iconfont icon-weizhi"></span>
        <p ref="li5">距离最近</p>
      </li>
      <li @click="search(6)">
        <span class="iconfont icon-08"></span>
        <p ref="li6">销量最高</p>
      </li>
      <li @click="search(1)">
        <span class="iconfont icon-qian"></span>
        <p ref="li1">起送价最低</p>
      </li>
      <li @click="search(2)">
        <span class="iconfont icon-shijian"></span>
        <p ref="li2">配送速度最快</p>
      </li>
      <li @click="search(3)">
        <span class="iconfont icon-shoucang"></span>
        <p ref="li3">评分最高</p>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  components: {},
  props: ['params'],
  data() {
    return {}
  },
  methods: {
    search(id) {
      window.console.log(id)
      this.$emit('getList', {
        order_by: id,
        New: true
      })
      this.$emit('Appear', 'sortMenu')
      this.$emit('off', 'sortMenu')
    }
  },
  mounted() {
    this.$refs[`li${this.params.order_by}`].style.color = '#26a2ff'
  }
}
</script>
<style  scoped>
* {
  padding: 0;
  margin: 0;
}
div {
  width: 100%;
}
li {
  background-color: white;
  display: flex;
  padding-left: 1rem;
  align-items: center;
  border-bottom: 1px #f5f5f5 solid;
}
span {
  font-size: 0.7rem;
  color: #26a2ff;
}
p {
  height: 2rem;

  line-height: 2rem;
  color: black;
  font-size: 0.7rem;
  padding-left: 0.5rem;
}
</style>  